import { useTokenStore } from '@/stores/token.js'
import request from '@/utils/request.js'//导入request.js请求工具
//研二奖学金查询
export const studentin2ListService = ()=>{
    // const tokenStore = useTokenStore();
    //在pinia中定义的响应式数据，都不需要.value可以直接使用
    // return request.get('/category',{headers:{'Authorization':tokenStore.token}})
    return request.get('/studentin2/selectlist')
}

export const calculate = (year)=>{
    return request.post('/studentin2/total', null, { params: { year } })
    //把参数转为url 单纯传year进去就是json 后端就要requestbody
    // 现在相当于/studentin2/total?year=2023
}




//模糊查询 post是请求体 get是拼接在url路径上 把keyword拼接在路径上
export const studentin2SelectByName=(keyword)=>{
    return request.get('/studentin2/selectbyname',{params:{keyword}})
}